<?php

declare(strict_types=1);

namespace App\Models;

use Hyperf\Database\Model\Relations\BelongsTo;

class PaymentChannelWechat extends Base
{
    protected $table = 'payment_channel_wechat';

    /**
     * 支付状态: 生成
     */
    const PAY_STATUS_GENERATE = 1;

    /**
     * 支付状态: 完成
     */
    const PAY_STATUS_SUCCESS = 2;

    /**
     * 支付状态: 取消
     */
    const PAY_STATUS_CANCEL = 3;

    /**
     * 支付状态: 失败
     */
    const PAY_STATUS_FAIL = 4;

    /**
     * 所属的订单
     * @return \Hyperf\Database\Model\Relations\BelongsTo
     */
    public function paymentOrder(): BelongsTo
    {
        return $this->belongsTo(PaymentOrder::class, 'order_id', 'order_id');
    }
}
